import openpyxl
from openpyxl.drawing.image import Image

# 示例图片URL列表
image_urls = [
    "https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1oC6Pn.img"
]

# 创建一个新的工作簿和工作表
wb = openpyxl.Workbook()
ws = wb.active
ws.title = "Images"

# 在工作表中插入图片URL
for idx, url in enumerate(image_urls, start=1):
    ws.cell(row=idx, column=1, value=url)

# 插入图片
for idx, url in enumerate(image_urls, start=1):
    img = Image(url)
    img.anchor = f"A{idx + 1}"  # 将图片插入到对应行的A列单元格
    ws.add_image(img)

# 保存工作簿
wb.save("Images.xlsx")